#ifndef SCANNER_H
#define SCANNER_H

#include "IAutomat.h"
#include "../Buffer/Buffer.h"
#include "../Symboltable/LexemStorage.h"
#include "../Symboltable/SymbolTable.h"
#include "Token.h"
#include "IScanner.h"
#include "IAutoScanner.h"
#include "PositionCounter.h"

#include <stddef.h>

class Scanner: public IScanner, public IAutoScanner {
private:
	IAutomat* automat;
	Buffer* buffer;
	LexemStorage lexemStorage;
	SymbolTable symbolTable;
	PositionCounter positionCounter;

	size_t tokenLenght;

public:
	Scanner(Buffer& newBuffer);
	~Scanner();
	bool nextToken(Token& t);
	void freeToken(Token* t);
	void mkToken(TokenType tt, Token& t);
	int ungetChar(const size_t i = 1);
	void stop();
};

#endif
